package org.nepu.srr;

import cn.hutool.core.lang.Validator;
import cn.hutool.json.JSONUtil;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.nepu.sc.mx.MxUtil;
import org.nepu.sc.mx.SafeMx;
import org.nepu.srr.作业井风险.B1OperationWellRiskParams;
import org.nepu.srr.作业人员风险.B5OperationPersonRiskParams;
import org.nepu.srr.安全管理文件.B3SafeManagementFileParams;
import org.nepu.srr.安全管理文件.安全管理文件.B31SafeManagementFileParams;
import org.nepu.srr.设备设施本体风险.B2EquipmentRiskParams;
import org.nepu.srr.设备设施资料.B4EquipmentDataParams;

import java.util.List;

@Data
@ApiModel(value = "作业前风险评价")
public class SafeRiskParams {

    B1OperationWellRiskParams b1;

    B2EquipmentRiskParams b2;

    B3SafeManagementFileParams b3;

    B4EquipmentDataParams b4;

    B5OperationPersonRiskParams b5;

    public SafeRiskParams jsonBuild(String jsonStr){
        if (Validator.isEmpty(jsonStr)){
            return new SafeRiskParams();
        }
        return JSONUtil.toBean(jsonStr, SafeRiskParams.class);
    }

    // 传入计算矩阵列表
    public SafeRiskResult rate(List<SafeMx> mxList, String taskId){
        SafeMx mx = MxUtil.filterMx(mxList, "b");
        return null;
    }

}
